//
//  TMListDetailCell.m
//  国学商家管理
//
//  Created by Tao Li on 2018/6/23.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "TMListDetailCell.h"
#import "TMCourseDetailModel.h"
//#import "TMTeacherRecordsModel.h"
@implementation TMListDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setIsStarsShow:(BOOL)isStarsShow{
    _isStarsShow = isStarsShow;
    if (_isStarsShow == YES) {
        self.starsView.hidden= NO;
    }else{
        self.starsView.hidden= YES;
        [self.detailLabel mas_updateConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.mas_right).offset(10);
        }];
    }
}
//- (void)setModel:(TMCourseRecordsModel *)model{
//    _model = model;
//    self.detailLabel.text = [NSString stringWithFormat:@"%@ %@ 到 %@ 上了%ld分钟课",model.username,[SPToolSet stringFromDateString:model.create_time],[SPToolSet stringFromDateString:model.end_time],(long)model.minute];
//}
#warning 教师记录缺少教师名称 以及课程名称
//- (void)setDeltailModel:(TMTeacherRecordsModel *)deltailModel{
//    _deltailModel = deltailModel;
//    if (_deltailModel.isDataRecords == YES) {
//        self.detailLabel.text = [NSString stringWithFormat:@"%@上了%@",deltailModel.tea_name,deltailModel.course];
//    }else{
//        self.detailLabel.text = [NSString stringWithFormat:@"%@上了毛笔练习课",[SPToolSet stringFromDateString:deltailModel.create_time]];
//    }
//}

- (void)setModel:(TMRecordsModel *)model{
    _model = model;
    //"te_id": 1,
    //"username": "官方",
    //"name": "雅思",
    //"create_time": 1532507911,
    //"end_time": 1532507999,
    //"minute": 1
    self.detailLabel.text = [NSString stringWithFormat:@"%@在%@上了%ld分钟%@课", model.username,[SPToolSet stringFromDateString:model.create_time], model.minute, model.name];
}

@end
